/*
 * @lc app=leetcode.cn id=1078 lang=typescript
 *
 * [1078] Bigram 分词
 */

// @lc code=start
function findOcurrences(text: string, first: string, second: string): string[] {
    let arr = text.split(" ");
    return arr.filter((i, index) => {
        const _first = arr[index - 2];
        const _second = arr[index - 1];
        if (_first === first && _second === second) {
            return true;
        }
        return false;
    });
}
// @lc code=end
